@model ShivamEMR.Model.Domain.UserDomain.User

@* This partial view defines form fields that will appear when creating and editing entities *@

   
<div class="editor-label">
    Employee
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.PersonID, ((IEnumerable<ShivamEMR.Model.Domain.CompanyDomain.Employee>)ViewBag.PossibleEmployees).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option.FullName).ToString(), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.ID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.PersonID)
</div>



<div class="editor-label">
    @Html.LabelFor(model => model.UserCode)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.UserCode)
    @Html.ValidationMessageFor(model => model.UserCode)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Name)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Name)
    @Html.ValidationMessageFor(model => model.Name)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Password)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Password)
    @Html.ValidationMessageFor(model => model.Password)
</div>


 
<div class="editor-label">
    Role
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.RoleID, ((IEnumerable<ShivamEMR.Model.Domain.UserDomain.UserRole>)ViewBag.PossibleRoles).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option.Role).ToString(), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.RoleID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.RoleID)
</div>
 
 <div class="editor-label">
    @Html.LabelFor(model => model.Notes)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Notes)
    @Html.ValidationMessageFor(model => model.Notes)
</div>
